#!/bin/sh

if [ "$(grep usbmode /etc/rc.local)" = "" ]; then
	sed -i 's:exit 0::g' /etc/rc.local
	cat <<-EOF >> /etc/rc.local
		/bin/sleep 5
		/sbin/usbmode -l 2>&1 /dev/null
		/bin/sleep 3
		/sbin/usbmode -s 2>&1 /dev/null
		exit 0
	EOF
fi

exit 0